// JavaScript Document

function $( v ){
	if( typeof v === 'function' ){
		window.onload = v;
	} else if ( typeof v === 'string' ) {
		return document.getElementById(v);
	} else if ( typeof v === 'object' ) {
		return v;
	}
}

function getStyle( obj, attr ){
	return obj.currentStyle ? obj.currentStyle[attr] : getComputedStyle( obj )[attr];
}

	//key:cookie名 value：cookie内容 t：cookie过期时间
	function setCookie(key,value,t){
		var oDate = new Date();
		oDate.setDate(oDate.getDate()+t);
		document.cookie=key+'='+value+';expires='+oDate.toGMTString();
	}

	function getCookie(key){
		var arr1 = document.cookie.split('; ');
		for(var i=0;i<arr1.length;i++){
		var arr2 = arr1[i].split('=');
		if(arr2[0]==key){return decodeURI(arr2[1]);}}
	}